using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using ScreenManagement;

namespace PokeMania
{

    /// <summary>
    /// Main Gameloop of XNA
    /// </summary>
    public class Game : Microsoft.Xna.Framework.Game
    {

#region Deklaration
        /// <summary>
        /// Contains all informations about graphics devices in the machine
        /// </summary>
        GraphicsDeviceManager graphics;

        /// <summary>
        /// Manages Output of Graphics on the Screen
        /// </summary>
        SpriteBatch spriteBatch;

        /// <summary>
        /// ScreenManager handles all Screen's which seperates the Gameloop into Partial Loops
        /// which handle only Visible Data. Also makes Code use- and readability much easier.
        /// </summary>
        ScreenManager screenManager;
#endregion

#region GameLoop
        public Game()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            screenManager = new ScreenManager(this);

            Components.Add(screenManager);

            screenManager.AddScreen(new Screens.Menu());
        }

        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize( )
        {
   
            base.Initialize();
        }

        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
        }

        /// <summary>
        /// UnloadContent will be called once per game and is the place to unload
        /// all content.
        /// </summary>
        protected override void UnloadContent()
        {
            // TODO: Unload any non ContentManager content here
        }
    }
#endregion

#region EntryPoint

    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
        {
            using (Game game = new Game())
            {
                game.Run();
            }
        }
    }
#endregion
}
